import React,{useState} from 'react';
import { Pagination,ConfigProvider  } from 'antd';
import zhCN from 'antd/lib/locale/zh_CN';


const CustomPagination = ({ totalPages,pageSize,onChange,currentPage}) => {

  const handleChange = (current) => {
    console.log(`当前页码: ${current}`);
    onChange(current) 
  };
  
  return (
    <ConfigProvider locale={zhCN}>
    <Pagination
      total={totalPages}
      pageSize={pageSize}
      current={currentPage}
      onChange={handleChange}
      showSizeChanger 
      showQuickJumper
    />
    </ConfigProvider>
  );
};
//传入总页数，每条数，事件回调,当前页码

export default CustomPagination;